package net.chrisrichardson.cloudtools.maven.plugins;

import net.chrisrichardson.ec2deployer.cluster.ClusterManager;
import net.chrisrichardson.ec2deployer.cluster.SimpleCluster;

/**
 * Goal which redeploys the web application on the Tomcat servers
 * 
 * @goal redeploy
 * 
 */
public class RedeployMojo extends AbstractClusterMojo {

  /**
   * 
   * @parameter
   * @required
   */
  protected String catalinaOptsBuilder;

  @Override
  protected void executeWithCluster(ClusterManager manager,
      SimpleCluster cluster) {
    if (catalinaOptsBuilder != null)
      cluster.getClusterInstance().getSpec().catalinaOptsBuilder(
          catalinaOptsBuilder);
    cluster.redeploy();
  }
}
